//import { BattleInfoModel } from "js/model/battleInfoModel"

class Random {
    initSeed: number
    seed: number
    constructor(seed?: number) {
       
            this.initSeed = seed || Math.floor(Math.random() * 233280)
            this.seed = this.initSeed
        

    }
    createSeed(): number {
        this.seed = Math.floor(Math.random() * 233280)
        return this.seed
    }
    setSeed(seed?: number) {
        this.seed = seed
    }
    getSeed() {
        return this.seed
    }
    getInitSeed() {
       
            return this.initSeed
        
    }
    intn(number: number): number {
        if (number == 0) {
            return 0
        }
      
            let value = (9301 * this.seed + 49297) % 233280
            this.seed = value
            return Math.ceil(value / 233280.0 * number)
        
    }
    floor(number: number): number {
        if (number == 0) {
            return 0
        }
      
            let value = (9301 * this.seed + 49297) % 233280
            this.seed = value
            return value / 233280.0 * number
        
    }
}
export default Random;